package com.hardson.toolkit.swing.table;

import java.util.List;

import javax.swing.table.AbstractTableModel;

class DTableModel extends AbstractTableModel {
	private static final long serialVersionUID = 1L;

	private List<CellData>[] listData;

	private int column;

	public DTableModel(final List<CellData>[] listData, final int column) {
		this.listData = listData;
		this.column = column;
	}

	public int getColumnCount() {
		return this.column;
	}

	public int getRowCount() {
		return this.listData.length;
	}

	public Object getValueAt(final int rowIndex, final int columnIndex) {
		CellData cellData = this.listData[rowIndex].get(columnIndex);
		return cellData == null ? null : cellData.getValue();
	}
}
